Attribute VB_Name = "resize2"
Option Explicit
Dim objects2() As Object
Dim baifen2() As Double
Dim rowes2() As Long
Public Function setrows2(rows As Long)
  ReDim rowes2(rows)
End Function
Public Function setrowandcolumn2(Row As Long, column As Long)
  rowes2(Row) = column
End Function
Public Function addobject2(a As Object, i As Integer, Row As Integer, tall As Long, tags As String)
  Set objects2(Row, i) = a
  objects2(Row, i).Top = tall
  objects2(Row, i).Tag = tags
End Function
Public Function objectdimi2(i As Long, Row As Long)
  Dim j As Long
  
  j = i * 2 + 1
  ReDim objects2(Row, i)
  ReDim baifen2(Row, j)
End Function
Public Function setbaifen2(a As Object)
  Dim ll_i, ll_j As Long
  Dim ll_a, ll_b
  For ll_j = 1 To UBound(rowes2)
    For ll_i = 1 To rowes2(ll_j) * 2 + 1
      If ll_i = 1 Then
         baifen2(ll_j, ll_i) = objects2(ll_j, ll_i).Left / a.Width
      ElseIf ll_i = rowes2(ll_j) * 2 + 1 Then
         baifen2(ll_j, ll_i) = (a.Width - objects2(ll_j, (rowes2(ll_j) - 1)).Left - objects2(ll_j, (rowes2(ll_j) - 1)).Width) / a.Width
      ElseIf (ll_i Mod 2) = 0 Then
         baifen2(ll_j, ll_i) = (objects2(ll_j, (ll_i / 2)).Width) / a.Width
      Else
         ll_a = CInt(ll_i / 2 + 0.5)
         baifen2(ll_j, ll_i) = objects2(ll_j, ll_a).Left / a.Width
      End If
    Next ll_i
  Next ll_j
End Function
Public Function objectresize2(f As Object, a As Object, w As Integer)
  Dim ll_i, ll_j As Long
  
  a.Width = f.Width - 200
  For ll_j = 1 To UBound(rowes2)
    For ll_i = 1 To rowes2(ll_j)
      objects2(ll_j, ll_i).Left = baifen2(ll_j, (ll_i * 2 - 1)) * a.Width
      If objects2(ll_j, ll_i).Tag = "Y" Then
        objects2(ll_j, ll_i).Width = baifen2(ll_j, (ll_i * 2)) * a.Width
      End If
    Next ll_i
  Next ll_j
End Function
Public Function init2()
  Call setrows2(2)
  Call setrowandcolumn2(1, 9)
  Call setrowandcolumn2(2, 8)
  Call objectdimi2(9, 2)
  Call addobject2(Form3.Label1, 1, 1, 250, "Y")
  Call addobject2(Form3.DateC1, 2, 1, 250, "Y")
  Call addobject2(Form3.Label3, 3, 1, 250, "Y")
  Call addobject2(Form3.CmbDept, 4, 1, 250, "Y")
  Call addobject2(Form3.Label5, 5, 1, 250, "Y")
  Call addobject2(Form3.Combo2, 6, 1, 250, "Y")
  Call addobject2(Form3.Text1, 7, 1, 250, "Y")
  Call addobject2(Form3.Command1, 8, 1, 250, "Y")
  Call addobject2(Form3.Command5, 9, 1, 250, "Y")
  Call addobject2(Form3.Label2, 1, 2, 750, "Y")
  Call addobject2(Form3.DateC2, 2, 2, 750, "Y")
  Call addobject2(Form3.Label4, 3, 2, 750, "Y")
  Call addobject2(Form3.Combo3, 4, 2, 750, "Y")
  Call addobject2(Form3.Label6, 5, 2, 750, "Y")
  Call addobject2(Form3.Combo1, 6, 2, 750, "Y")
  Call addobject2(Form3.Command4, 7, 2, 750, "Y")
  Call addobject2(Form3.Command2, 8, 2, 750, "Y")
  Call setbaifen2(Form3.Frame1)
End Function

